<template>
	<view>
		<image mode="widthFix" class="image posiab" src="/static/xaing.png"></image>
		<view class="posiab zindex5" :style="{paddingTop:shh+'px'}">
			<view @click="back"  class="flex-ju-c mt30 wh70-70 ra100 mt30 ml30 ">
				<view  class="" >
					<image mode="widthFix" class="image width32   " src="/static/back.png"></image>
				</view>
			</view>
		</view>
		<view class="colorfff posire  pt19vh">
			<view class="flex-ju-c">
				<image v-if="info.is_box==1" class="image wh465-465 ra20" src="/static/box.png"></image>
				<image v-else class="image wh465-465 ra20" :src="info.info.thumb"></image>
			</view>
			<view class="flex-ju-c size31 mt150">{{info.info.title}}</view>
			<view class="flex-ju-c mt30">
			<view 
				class="flex-a-i size24 borderccc ra10 hidden mr20">
				<view class="ibgtoCAF881-A0E99A color000 pt5 pb5 pl10 pr10">限量</view>
				<view class="pr10 pl10 size28">{{info.info.sell_num}}份</view>
			</view>
			<view
				class="flex-a-i size24 borderccc ra10 hidden ml20">
				<view class="ibgtoCAF881-A0E99A color000 pt5 pb5 pl10 pr10">流通</view>
				<view class="pr10 pl10 size28">{{info.info.release_num}}份</view>
			</view>
			</view>
			<view class="bgfff mt50 pg30 color000" style="border-top-right-radius: 40rpx;border-top-left-radius: 40rpx;">
				<!-- <view class="flex-a-i">
					<image src="/static/aaa.png" class="wh83-83 ra83"></image>
					<view class="ml20">
						<view class="size26">创作者的名字</view>
						<view class="color999 size25">500粉丝</view>
					</view>
				</view> -->
				<view v-if="info.is_box==1" class="bgF5F6F7 size26 ra20 pg30-20 mt20">
					<view class="size30 bold">盲盒信息</view>
					<scroll-view scroll-x class="mt30">
						<view class="flex center">
							<view class="mr20" v-for="(item,u) in info.box_info" :key="u">
								<image :src="item.thumb" class="wh185-185 ra15"></image>
								<view class="one">{{item.title}}</view>
								<view class="color999">{{item.odds}}%</view>
							</view>
						</view>
					</scroll-view>
				</view>
				<view v-else :class="theme?'bg292929 colorfff':'bgF5F6F7'" class="borderE1E1E1 size26 ra20 pg30-20 mt20">
					<view class="size30 bold">链上信息</view>
					<view class="flex-ju-b mt20 ">
						<view class="color999">所在产链</view>
						<view  class="color35B1FF">
						{{info.info.link_name}}</view>
					</view>
					<view class="flex-ju-b mt20">
						<view  class="color999">合约地址</view>
						<view :class="theme?'color999':'color333'" class="">
						{{info.info.link_address.substring(0,3)}}****{{info.info.link_address.substring(info.info.link_address.length-3,999)}}</view>
					</view>
					<view class="flex-ju-b mt20">
						<view  class="color999">支付钱包</view>
						<view :class="theme?'color999':'color333'">{{info.info.pay_type}}</view>
					</view>
					<view class="flex-ju-b mt20">
						<view  class="color999">发行时间</view>
						<view :class="theme?'color999':'color333'">{{info.info.created_at}}</view>
					</view>
				</view>
				
				<view :class="theme?'bg292929 colorfff':'bgF5F6F7'" class="borderE1E1E1 size26 ra20 pg30-20 mt20 mb150">
					<view class="size30 bold mb20">藏品详情</view>
					<image mode="widthFix" class="image" v-for="(item,index) in info.info.images" :src="item"></image>
					<view class="size30 bold mb20 mt20">购买须知</view>
					<view class="color999">
						<view class="mb30">
							数字藏品交易仅限于18周岁(不含)以上、60周岁(含)以下，并已完成实名认证的中国大陆用户购买。由于不同属性的数字艺术有不同的二次交易规则，请您仔细阅读并同意相关规则后再进行相应操作，以避免不必要的损失。
						</view>
						请注意，一旦数字藏品完成出售，不支持退货在购买之前，请仔细考虑您的购买决策。根据我国相关的法律要求，特定条件下的数字藏品的二次交易不支持任何形式的变相炒作。我们坚决反对数字藏品炒作、场外交易、欺诈，以及其他非法侵权行为。请您甄别上述涉嫌网络欺诈的行为并了解相关风险。
					</view>
				</view>
				
				<view class=" posifi width92vw bottom0 " >
					<view class="ra20 flex-ju-b pg30 bgfff height80"  style="box-shadow: 0rpx -8rpx 24rpx 0rpx rgba(0,0,0,0.06);">
						<view class="bold size62  " >
							<text class="size31">¥ </text> {{info.info.money_price / 100}}
						</view>
						<view @click="tappays"  class="bold wh330-100 bg000 colorfff ra20 flex-ju-c   size29  ">
							{{info.but.but}}
						</view>
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				hidden:uni.getStorageSync('hidden'),
				theme: uni.getStorageSync('theme'),
				info:{
					but:{},
					info:{
						link_address:""
					}
				}
			}
		},
		onLoad(option) {
			this.http(`products/${option.uuid}`).then(res => {
				if(!res.data.info.link_address){
					res.data.info.link_address = '0x24A42B76b6EE6cA87486B0FDA8C9cebA1e0Bd752'
				}
				this.info = res.data
			})
		},
		methods: {
			tappays(){
				if(this.info.but.is_login){
					if (this.info.but.buy) {
						uni.navigateTo({
							url: `order?uuid=${this.info.info.uuid}`
						})
					}
				}else{
					uni.reLaunch({
						url: '/pages/login'
					})
				}
				
			}
			
		}
	}
</script>


<style>

</style>
